﻿using System.Threading.Tasks;

namespace Sidvall.Security
{
    public class AccountManager
    {
        #region Public Members

        public Sidvall.Security.IAccountProvider AccountProvider { get; set; }

        #region SendResetPasswordEmailAsync

        public async Task SendResetPasswordEmailAsync(string email)
        {
            await this.AccountProvider.SendResetPasswordEmailAsync(email).ConfigureAwait(false);
        }

        #endregion
        #region ResetPasswordAsync

        public async Task ResetPasswordAsync(string email, string securityToken, string newPassword)
        {
            await this.AccountProvider.ResetPasswordAsync(email, securityToken, newPassword).ConfigureAwait(false);
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return "AccountManager - IAccountProvider";
        }

        #endregion

        #endregion
        #region Constructors

        public AccountManager(Sidvall.Security.IAccountProvider accountProvider)
        {
            this.AccountProvider = accountProvider;
        }

        #endregion
    }
}
